package com.baiyun.yunpan.dao;

import com.baiyun.yunpan.entity.User;
import org.apache.ibatis.annotations.Insert;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface UserDao {
    @Insert("insert into user values(null,#{username},#{password},null,null,#{registertime},#{realname},null,0,1024*10,0)")
    public void reg(User user);

    @Update("update user set sex=#{sex},phone=#{phone},realname=#{realname},signature=#{signature} where id=#{id}")
    public void uodate(User user);

    @Select("select sex,phone,realname,signature,username  from user where id = #{id}")
    public User getUserById(int id);

    @Select("select * from user where username = #{username} and password = #{password}")
    public User login(User user );

    @Select("select * from user where username = #{username}")
    public User getUserByName(User user);




}
